package com.lgst.ticket;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by L on 2017/1/16.
 */

public class TicketInfo implements Parcelable {
    private String station;
    private String date;
    private String time;
    private String destination;
    private String ticketNum;
    private String carType;
    private String price;

    public TicketInfo() {
    }

    protected TicketInfo(Parcel in) {
        station = in.readString();
        date = in.readString();
        time = in.readString();
        destination = in.readString();
        ticketNum = in.readString();
        carType = in.readString();
        price = in.readString();
    }

    public static final Creator<TicketInfo> CREATOR = new Creator<TicketInfo>() {
        @Override
        public TicketInfo createFromParcel(Parcel in) {
            return new TicketInfo(in);
        }

        @Override
        public TicketInfo[] newArray(int size) {
            return new TicketInfo[size];
        }
    };

    public String getStation() {
        return station;
    }

    public void setStation(String station) {
        this.station = station;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getTicketNum() {
        return ticketNum;
    }

    public void setTicketNum(String ticketNum) {
        this.ticketNum = ticketNum;
    }

    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TicketInfo)) return false;
        TicketInfo that = (TicketInfo) o;
        return that.date.equals(this.date)&&that.time.equals(time);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(station);
        parcel.writeString(date);
        parcel.writeString(time);
        parcel.writeString(destination);
        parcel.writeString(ticketNum);
        parcel.writeString(carType);
        parcel.writeString(price);
    }
}
